package a.f.d.a;

import a.c.e;
import a.c.i;
import a.c.k;
import a.c.m;
import a.c.n;
import a.c.w;
import a.c.x;
import a.f.bd;
import a.f.o;
import a.i.db;

class l
{
  private static final Object a = "AutoEdgeGroupConstraintHandler.TEST_SOURCE_GROUP_ID";
  private static final Object b = "AutoEdgeGroupConstraintHandler.TEST_TARGET_GROUP_ID";
  
  private static boolean a(a.c.d paramd, bc parambc, boolean paramBoolean, k paramk)
  {
    boolean bool = d.R;
    if (paramBoolean)
    {
      if ((bool) || ((paramk != null) && (paramk.get(paramd.e()) != null))) {
        return false;
      }
      localy = parambc.a(paramd);
      if ((bool) || (localy != null))
      {
        if (!bool) {
          if (localy.d() != null)
          {
            if (bool) {
              break label89;
            }
            if (!localy.d().g()) {
              return false;
            }
          }
        }
        label89:
        if ((bool) || (localy.e() != null))
        {
          if (bool) {
            break label125;
          }
          if (!localy.e().isEmpty()) {
            return false;
          }
        }
      }
      label125:
      return true;
    }
    if ((bool) || ((paramk != null) && (paramk.get(paramd.f()) != null))) {
      return false;
    }
    y localy = parambc.a(paramd);
    if ((bool) || (localy != null))
    {
      if (!bool) {
        if (localy.f() != null)
        {
          if (bool) {
            break label206;
          }
          if (!localy.f().g()) {
            return false;
          }
        }
      }
      label206:
      if ((bool) || (localy.g() != null))
      {
        if (bool) {
          break label242;
        }
        if (!localy.g().isEmpty()) {
          return false;
        }
      }
    }
    label242:
    return true;
  }
  
  static void a(o paramo, ac paramac, bc parambc, rb paramrb)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    k localk = paramo.c(bd.a);
    x localx = db.a();
    int i = 0;
    label120:
    label122:
    do
    {
      if (i >= paramac.a()) {
        break;
      }
      localObject1 = paramac.a(i);
      localObject2 = ((vb)localObject1).c().l();
      do
      {
        if (!((w)localObject2).e()) {
          break;
        }
        localObject3 = ((w)localObject2).d();
        localx.a(localObject3, i);
        ((w)localObject2).f();
        if (bool2) {
          break label122;
        }
        if (bool1) {
          break label120;
        }
      } while (!bool1);
      if (!bool2) {
        i++;
      }
    } while (!bool1);
    n localn = db.b();
    Object localObject1 = db.b();
    Object localObject2 = new a.i.a.d(paramo);
    Object localObject3 = new a.i.a.d(paramo);
    a.i.a.d locald1 = new a.i.a.d(paramo);
    a.i.a.d locald2 = new a.i.a.d(paramo);
    w localw = paramo.v();
    int m;
    int n;
    label298:
    label336:
    Object localObject8;
    Object localObject9;
    while (localw.e())
    {
      e locale1 = localw.d();
      m = 0;
      n = 0;
      if (bool1) {
        break label1491;
      }
      m localm1 = locale1.n();
      do
      {
        if (!localm1.e()) {
          break;
        }
        a.c.d locald = localm1.a();
        if (bool1) {
          break label336;
        }
        if (!locald.g())
        {
          if (bool2) {
            continue;
          }
          if (a(locald, parambc, true, localk))
          {
            if (!bool2)
            {
              if (a(locald, localx)) {
                n++;
              }
            }
            else
            {
              if (bool2) {
                continue;
              }
              if (!bool1) {
                break label298;
              }
            }
            m++;
          }
        }
        localm1.f();
      } while (!bool1);
      ((a.i.a.d)localObject2).a(locale1, -m);
      locald1.a(locale1, -n);
      if (!bool2)
      {
        int i1 = 0;
        int i2 = 0;
        localObject8 = locale1.m();
        label428:
        label440:
        do
        {
          do
          {
            if (!((m)localObject8).e()) {
              break label440;
            }
            localObject9 = ((m)localObject8).a();
            if (bool1) {
              break;
            }
            if (!((a.c.d)localObject9).g())
            {
              if (bool2) {
                continue;
              }
              if (a((a.c.d)localObject9, parambc, false, localk))
              {
                if (!bool2)
                {
                  if (a((a.c.d)localObject9, localx)) {
                    i2++;
                  }
                }
                else
                {
                  if (bool2) {
                    continue;
                  }
                  if (!bool1) {
                    break label428;
                  }
                }
                i1++;
              }
            }
            ((m)localObject8).f();
          } while (!bool1);
          ((a.i.a.d)localObject3).a(locale1, -i1);
          locald2.a(locale1, -i2);
          localw.f();
        } while (bool2);
        if (bool1)
        {
          break label1293;
          break label1105;
          break label907;
          break label714;
        }
      }
    }
    label477:
    if (((a.i.a.d)localObject2).a()) {
      label482:
      if ((!bool2) && (locald1.a())) {
        break label1482;
      }
    }
    label602:
    label885:
    label1276:
    while (bool2) {
      if ((bool2) || ((!((a.i.a.d)localObject3).a()) || ((bool2) || (!locald2.a()))))
      {
        int j = 0;
        int k = 0;
        m = 0;
        n = 0;
        if (!bool2) {
          if (!((a.i.a.d)localObject2).a()) {
            m = -((a.i.a.d)localObject2).f();
          }
        }
        if (!bool2) {
          if (!locald1.a())
          {
            if (bool2) {
              break label602;
            }
            if (-locald1.f() >= m)
            {
              m = -locald1.f();
              n = 1;
            }
          }
        }
        if (!bool2) {
          if (!((a.i.a.d)localObject3).a()) {
            j = -((a.i.a.d)localObject3).f();
          }
        }
        if (!bool2) {
          if (!locald2.a())
          {
            if (bool2) {
              break label661;
            }
            if (-locald2.f() >= j)
            {
              j = -locald2.f();
              k = 1;
            }
          }
        }
        if (!bool2) {
          if (j <= 1)
          {
            if (!bool2) {
              if (m <= 1) {
                continue;
              }
            }
          }
          else {
            if (bool2) {
              break label1088;
            }
          }
        }
        e locale2;
        m localm2;
        if (j > m)
        {
          if (k != 0)
          {
            locale2 = locald2.c();
            localm2 = locale2.m();
            if (!localm2.e()) {
              break label477;
            }
            localObject8 = localm2.a();
            if (bool2) {
              break label1338;
            }
            if (bool1) {
              break label1336;
            }
            if (localn.get(localObject8) == null)
            {
              if (bool2) {
                break label885;
              }
              if (!((a.c.d)localObject8).g())
              {
                if (bool2) {
                  break label885;
                }
                if (a((a.c.d)localObject8, parambc, false, localk))
                {
                  if (bool2) {
                    break label885;
                  }
                  if (a((a.c.d)localObject8, localx))
                  {
                    localObject9 = "inbackward" + locale2.f();
                    ((n)localObject1).a(localObject8, localObject9);
                    if (bool2) {
                      break label885;
                    }
                    if (locald1.a(((a.c.d)localObject8).e())) {
                      locald1.d(((a.c.d)localObject8).e(), locald1.b(((a.c.d)localObject8).e()) + 1);
                    }
                  }
                }
              }
            }
            localm2.f();
            if (!bool1) {
              break;
            }
          }
          locale2 = ((a.i.a.d)localObject3).c();
          if (bool2) {
            break label1291;
          }
          localm2 = locale2.m();
          if (!localm2.e()) {
            break label477;
          }
          localObject8 = localm2.a();
          if (bool2) {
            break label1338;
          }
          if (bool1) {
            break label1336;
          }
          if (localn.get(localObject8) == null)
          {
            if (bool2) {
              break label1078;
            }
            if (!((a.c.d)localObject8).g())
            {
              if (bool2) {
                break label1078;
              }
              if (a((a.c.d)localObject8, parambc, false, localk))
              {
                if (bool2) {
                  break label1078;
                }
                if (!a((a.c.d)localObject8, localx))
                {
                  localObject9 = "inforward" + locale2.f();
                  ((n)localObject1).a(localObject8, localObject9);
                  if (bool2) {
                    break label1078;
                  }
                  if (((a.i.a.d)localObject2).a(((a.c.d)localObject8).e())) {
                    ((a.i.a.d)localObject2).d(((a.c.d)localObject8).e(), ((a.i.a.d)localObject2).b(((a.c.d)localObject8).e()) + 1);
                  }
                }
              }
            }
          }
          localm2.f();
          if (!bool1) {
            break;
          }
        }
        if (bool2) {
          break label482;
        }
        if (n != 0)
        {
          locale2 = locald1.c();
          localm2 = locale2.n();
          if ((!bool2) && (!localm2.e())) {
            break label477;
          }
          localObject8 = localm2.a();
        }
        do
        {
          do
          {
            do
            {
              do
              {
                if (bool1) {
                  break label1346;
                }
                if (((n)localObject1).get(localObject8) == null)
                {
                  if (bool2) {
                    break label1276;
                  }
                  if (!((a.c.d)localObject8).g())
                  {
                    if (bool2) {
                      break label1276;
                    }
                    if (a((a.c.d)localObject8, parambc, true, localk))
                    {
                      if (bool2) {
                        break label1276;
                      }
                      if (a((a.c.d)localObject8, localx))
                      {
                        localObject9 = "outbackward" + locale2.f();
                        localn.a(localObject8, localObject9);
                        if (bool2) {
                          break label1276;
                        }
                        if (locald2.a(((a.c.d)localObject8).f())) {
                          locald2.d(((a.c.d)localObject8).f(), locald2.b(((a.c.d)localObject8).f()) + 1);
                        }
                      }
                    }
                  }
                }
                localm2.f();
                if (!bool1) {
                  break;
                }
                locale2 = ((a.i.a.d)localObject2).c();
                localm2 = locale2.n();
                if (!localm2.e()) {
                  break label477;
                }
                localObject8 = localm2.a();
              } while (bool2);
            } while ((!bool2) && (bool1));
          } while (bool2);
        } while (bool1);
        if (((n)localObject1).get(localObject8) == null)
        {
          if (bool2) {
            break label1479;
          }
          if (!((a.c.d)localObject8).g())
          {
            if (bool2) {
              break label1479;
            }
            if (a((a.c.d)localObject8, parambc, true, localk))
            {
              if (bool2) {
                break label1479;
              }
              if (!a((a.c.d)localObject8, localx))
              {
                localObject9 = "outforward" + locale2.f();
                localn.a(localObject8, localObject9);
                if (bool2) {
                  break label1479;
                }
                if (((a.i.a.d)localObject3).a(((a.c.d)localObject8).f())) {
                  ((a.i.a.d)localObject3).d(((a.c.d)localObject8).f(), ((a.i.a.d)localObject3).b(((a.c.d)localObject8).f()) + 1);
                }
              }
            }
          }
        }
        localm2.f();
        if (!bool1) {
          break;
        }
      }
    }
    label661:
    label714:
    label1105:
    label1491:
    Object localObject4 = paramo.w();
    label907:
    label1078:
    label1088:
    label1346:
    label1479:
    label1482:
    Object localObject5;
    label1291:
    label1293:
    label1336:
    label1338:
    Object localObject6;
    do
    {
      do
      {
        if (!((m)localObject4).e()) {
          break;
        }
        localObject5 = ((m)localObject4).a();
        localObject6 = localn.get(localObject5);
        Object localObject7 = ((n)localObject1).get(localObject5);
        paramrb.a((a.c.d)localObject5, localObject6, localObject7);
        ((m)localObject4).f();
        if (bool2) {
          break label1689;
        }
        if (bool1) {
          break label1669;
        }
      } while (!bool1);
    } while (bool2);
    if (!bool2) {
      if ((paramo.c(a) instanceof i))
      {
        localObject4 = (i)paramo.c(a);
        localObject5 = paramo.w();
        do
        {
          if (!((m)localObject5).e()) {
            break;
          }
          localObject6 = ((m)localObject5).a();
          ((i)localObject4).a(localObject6, localn.get(localObject6));
          ((m)localObject5).f();
          if ((!bool2) && (bool1)) {
            return;
          }
        } while (!bool1);
      }
    }
    label1669:
    if ((!bool2) && ((bool2) || ((paramo.c(b) instanceof i))))
    {
      label1689:
      localObject4 = (i)paramo.c(b);
      localObject5 = paramo.w();
      do
      {
        if (!((m)localObject5).e()) {
          break;
        }
        localObject6 = ((m)localObject5).a();
        ((i)localObject4).a(localObject6, ((n)localObject1).get(localObject6));
        ((m)localObject5).f();
      } while (!bool1);
    }
  }
  
  private static boolean a(a.c.d paramd, x paramx)
  {
    if (!d.R) {}
    return paramx.getInt(paramd.e()) > paramx.getInt(paramd.f());
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.l

 * JD-Core Version:    0.7.0.1

 */